﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SoccerSimulator5000
{
    public class Round
    {
        public List<Match> round { get; set; }

        public Round(  )
        {
            round = new List<Match>();
        }

        public void Draw( int x, int y, System.Drawing.Graphics g)
        {
            System.Drawing.Font theFont = new System.Drawing.Font("Courier New", 15);

            

            int i = 0;
            foreach (var Match in round)
            {
                object[] arg = { Match.homeTeam.name, Match.homeGoals, Match.awayGoals, Match.awayTeam.name };
                string match = string.Format("{0,-20}{1,2}-{2,-2}{3,20}", arg);

                if (i == 0)
                {
                    g.FillRectangle(System.Drawing.Brushes.Aquamarine, x, y, 750, 40);
                    g.DrawRectangle(new System.Drawing.Pen(System.Drawing.Brushes.Black), x, y, 750, 40);
                    i++;
                }
                else
                {
                    g.FillRectangle(System.Drawing.Brushes.AntiqueWhite, x, y, 750, 40);
                    g.DrawRectangle(new System.Drawing.Pen(System.Drawing.Brushes.Black), x, y, 750, 40);
                    i = 0;
                }
                g.DrawString(match, theFont, System.Drawing.Brushes.Black, new System.Drawing.PointF(x + 1, y + 10));

                y = y + 40;

            }

        }


    }
}
